using System.Globalization;
using System.Data.SqlClient;

using ROC.Resources.Library.Data;
using ROC.Resources.Library.Data.SQL2005;

namespace MoneyManagerPro.Resources.Repository.Users
{
    internal class GetAllFromUsersSelectionFactory : ISelectionFactory<NullableIdentity>, ROC.Resources.Library.Data.Generic.IDbToBusinessEntityNameMapper
    {
        public GetAllFromUsersSelectionFactory()
        {
        }

        #region ISelectionFactory<NullableIdentity> Members

        public System.Data.SqlClient.SqlCommand ConstructSelectCommand(SqlDatabase db, NullableIdentity idObject)
        {
            SqlCommand command = db.GetStoredProcCommand("ReadUsers");
            return command;
        }

        #endregion

        #region IDbToBusinessEntityNameMapper Members

        public string MapDbParameterToBusinessEntityProperty(string dbParameter)
        {
            switch (dbParameter)
            {
                default:
                    throw new System.ArgumentException(string.Format(CultureInfo.CurrentCulture, ROC.Resources.Library.Data.Generic.GenericResources.InvalidParameterName), dbParameter);
            }
        }

        #endregion
    }
}
